<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>backslash (\)</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 27/12/2005</div>
    <p>
      <b>backslash (\)</b> - left matrix division.</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>x=A\b</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
			Backslash denotes left matrix division. 
			<tt>
        <b>x=A\b</b>
      </tt> is a solution to <tt>
        <b>A*x=b</b>
      </tt>.</p>
    <p>
			If <tt>
        <b>A</b>
      </tt> is square and nonsingular <tt>
        <b>x=A\b</b>
      </tt> (uniquely defined) is equivalent to <tt>
        <b>x=inv(A)*b</b>
      </tt> (but the computations are much cheaper).
		</p>
    <p>
			If <tt>
        <b>A</b>
      </tt> is not square, <tt>
        <b>x</b>
      </tt> is a least square solution.
			i.e. <tt>
        <b>norm(A*x-b)</b>
      </tt> is minimal (euclidian norm). If <tt>
        <b>A</b>
      </tt> is full
			column rank, the least square solution, <tt>
        <b>x=A\b</b>
      </tt>, is uniquely 
			defined (there is a unique <tt>
        <b>x</b>
      </tt> which minimizes <tt>
        <b>norm(A*x-b)</b>
      </tt>).
			If <tt>
        <b>A</b>
      </tt> is not full column rank, then the least square
			solution is not unique, and <tt>
        <b>x=A\b</b>
      </tt>, in general, is not the solution
			with minimum norm (the minimum norm solution is <tt>
        <b>x=pinv(A)*b</b>
      </tt>).
		</p>
    <p>
      <tt>
        <b>A.\B</b>
      </tt>  is the matrix with <tt>
        <b>(i,j)</b>
      </tt> entry <tt>
        <b>A(i,j)\B(i,j)</b>
      </tt>.
			If <tt>
        <b>A</b>
      </tt> (or <tt>
        <b>B</b>
      </tt>) is a scalar <tt>
        <b>A.\B</b>
      </tt> is equivalent to 
			<tt>
        <b>A*ones(B).\B</b>
      </tt> (or <tt>
        <b>A.\(B*ones(A))</b>
      </tt>
    </p>
    <p>
      <tt>
        <b>A\.B</b>
      </tt>  is an operator with no predefined meaning. It may be used
			to define a new operator (see overloading) with  the same precedence as * or /.
		</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

A=rand(3,2);b=[1;1;1]; x=A\b; y=pinv(A)*b;  x-y
A=rand(2,3);b=[1;1]; x=A\b; y=pinv(A)*b; x-y, A*x-b, A*y-b
A=rand(3,1)*rand(1,2); b=[1;1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b
A=rand(2,1)*rand(1,3); b=[1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b 

</pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="slash.htm">
        <tt>
          <b>slash</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../linear/inv.htm">
        <tt>
          <b>inv</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../linear/pinv.htm">
        <tt>
          <b>pinv</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="percent.htm">
        <tt>
          <b>percent</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="ieee.htm">
        <tt>
          <b>ieee</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
